<?php

Class UserModel extends RelationModel{
	/*
	 * 定义关联关系
	 */
	protected $_link = array(
		'tweets' => array(
			'mapping_type' => HAS_MANY,
			'class_name' => 'tweets',
			'foreign_key' => 'user_id',
		),
		'comment' => array(
			'mapping_type' => HAS_MANY,
			'class_name' => 'comment',
			'foreign_key' => 'user_id',
		),
		'message' => array(
			'mapping_type' => HAS_MANY,
			'class_name' => 'message',
			'foreign_key' => 'user_id',
		),
		'notice' => array(
			'mapping_type' => HAS_MANY,
			'class_name' => 'notice',
			'foreign_key' => 'user_id',
		),
		'report' => array(
			'mapping_type' => HAS_MANY,
			'class_name' => 'report',
			'foreign_key' => 'user_id',
		),
		'school' => array(
			'mapping_type' => BELONGS_TO,
			'class_name' => 'school',
			'foreign_key' => 'school_id',
			'mapping_fields' => 'school_name',
			'as_fields' => 'school_name',
		),
		'user_follow' => array(
			'mapping_type' => MANY_TO_MANY,
			'class_name' => 'location',
			'foreign_key' => 'user_id',
			'relation_foreign_key' => 'location_id',
			'relation_table' => "agl_user_follow_location",
		),
	);
	
	/*
	 * 表单数据验证 
	 */
	protected $_validate=array(
		
	);
	
		/*
	 * 数据自动完成 
	 */
	protected $_auto=array(
		
	);
	
	/*
	 * 表单项与字段的映射
	 */
}
?>
